﻿CREATE PROCEDURE [dbo].[yaf_replace_words_save](
                @ID       INT  = NULL,
                @badword  NVARCHAR(255),
                @goodword NVARCHAR(255))
AS
    BEGIN
        IF @ID IS NULL 
            OR @ID = 0
        BEGIN
            INSERT INTO yaf_replace_words
                       (badword,
                        goodword)
            VALUES     (@badword,
                        @goodword)
        END
        ELSE
        BEGIN
            UPDATE yaf_replace_words
            SET    badword = @badword,
                   goodword = @goodword
            WHERE  ID = @ID
        END
    END


